﻿#if UNITY_EDITOR


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;

namespace libx
{


    public class ExtButtonAttribute : PropertyAttribute
    {
        public string type;
        public ExtButtonAttribute(string type)
        {
            this.type = type;
        }
    }


    [CustomPropertyDrawer(typeof(ExtButtonAttribute))]
    public class BundleRulePropertyDrawer2 : DecoratorDrawer
    {

        public override void OnGUI(Rect position)
        {
            Debug.Log($"typeId: {this.attribute.TypeId.GetType().Name}");

            position.height = 18;
            if (GUI.Button(position, "x"))
            {
                Debug.Log($"del");
            }
            
        }

        public override float GetHeight()
        {
            return base.GetHeight() + 8;
        }

    }



    //[CustomPropertyDrawer(typeof(BundleRule))]
    //public class BundleRulePropertyDrawer : PropertyDrawer
    //{

    //    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    //    {
    //        Debug.Log($"name:{property.name}");

    //        base.OnGUI(position, property, label);
    //    }

    //    public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
    //    {
    //        return base.GetPropertyHeight(property, label);
    //    }
    //}


}


#endif

